require('../css/detail.less')
document.ready(function () {
    let obj = utils.strToObj(location.search);
    // console.log(obj.id);
    let user = JSON.parse(localStorage.getItem('user'))
    // console.log(user);
    let imgDom = document.querySelector('.imge')
    let name = document.querySelector('.name')
    let cate = document.querySelector('.cate')
    let desc = document.querySelector('.desc')
    user.forEach(function(item,index){
        console.log(item);
        if(obj.id==item.id){
            imgDom.src=item.book_imgurl
            name.textContent=item.book_name
            cate.textContent=item.book_cate
            desc.textContent=item.book_desc
            
        }
    })
    
    $http.get('/book/detail/' + obj.id, function (res) {
        // console.log(res);

        
    })


})